App.Api.factory('Api.Newuser', [function () {
			/**
* Tworzy nowego użytkownika, o dowolnej roli. Tylko admin ma prawo tworzyć użytkowników.
* @class newuser
*/
	function newuser(){
		/**
		* newuser
		* @property oper
		* @private 
		*/
		var oper = 'newuser',

		/**
		*  użytkownik, którego rola to admin, zostaje właścicielem
		* @property user 
		* @private 
		*/
		user ,

		/**
		*  hasło tego użytkownika
		* @property pass 
		* @private 
		*/
		pass ,

		/**
		*  login nowego użytkownika
		* @property login 
		* @private 
		*/
		login ,

		/**
		*  hasło nowego użytkownika
		* @property npas 
		* @private 
		*/
		npas ,

		/**
		*  rola
		* @property role 
		* @private 
		*/
		role ,

		/**
		*  rola
		* @property role 
		* @private 
		*/
		role ,
		that = this;


		function getOper(noper){
			return oper;
		}
		function getUser(nuser){
			return user ;
		}
		function getPass(npass){
			return pass ;
		}
		function getLogin(nlogin){
			return login ;
		}
		function getNpas(nnpas){
			return npas ;
		}
		function getRole(nrole){
			return role ;
		}
		function setUser(nuser){
			user  = nuser ;
		}
		function setPass(npass){
			pass  = npass ;
		}
		function setLogin(nlogin){
			login  = nlogin ;
		}
		function setNpas(nnpas){
			npas  = nnpas ;
		}
		function setRole(nrole){
			role  = nrole ;
		}

		function toObject(){
			return{
				oper: oper,
				user : user ,
				pass : pass ,
				login : login ,
				npas : npas ,
				role : role 
			};
		}

		/**
	 	* konstruktor
	 	*
	   	* @constructor         
	  	* @method construct    
	  	* @public              
	 	*/
		(function newuser(){
			that.getOper = getOper;
			that.getUser = getUser;
			that.getPass = getPass;
			that.getLogin = getLogin;
			that.getNpas = getNpas;
			that.getRole = getRole;
			that.setUser = setUser;
			that.setPass = setPass;
			that.setLogin = setLogin;
			that.setNpas = setNpas;
			that.setRole = setRole;
			that.toObject = toObject;
		})();
	}
	newuser.fromObject = function (obj){
		var object = new newuser();
		object.setUser(obj.user);
		object.setPass(obj.pass);
		object.setLogin(obj.login);
		object.setNpas(obj.npas);
		object.setRole(obj.role);
		return object;
	}
	return newuser;
}]);